<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>

    <script type="application/javascript" src="../js/jquery-1.11.1.min.js"></script>

</head>
<body>
<div style="padding: 30px;">

    <a href="list.html"> 返回列表 </a>


    <h1> 添加用户 </h1>


    <form id="zzyForm">
        name:<input name="name" type="text" value=""/>
        <br/><br/>
        address:<input name="address" type="text" value=""/>
    </form>
    <br/><br/>
    <button onclick="save()">提交</button>
</div>
</body>

<script>
    function save() {
        $.ajax({
            type: "POST",
            url: "http://127.0.0.1:8082/users/save",
            dataType:"json",
            data:$("#zzyForm").serialize(),
            async: false,
            success: function (data) {
                console.log(data)
                alert(data);
            },
            error: function(data) {
                console.log("出错："+data);
            }
        });
    }
</script>

</html>